import { useState, useCallback } from 'react';

// 自定义 Hook 用于处理表单输入
export function useFormInput(initialValue = '') {
  const [value, setValue] = useState(initialValue);
  
  const handleChange = useCallback((e) => {
    setValue(e.target.value);
  }, []);
  
  const reset = useCallback(() => {
    setValue('');
  }, []);
  
  return {
    value,
    onChange: handleChange,
    reset
  };
} 